<include file="../header" />
<body class="J_scroll_fixed">
<script>

        $(document).ready(function() {

            $('button.viewClassRecord').click(function () {

                var id = $(this).attr("id");
                layer.open({

                    type: 2,
                    title: '上课记录查看',
                    maxmin: false,
                    shadeClose: true, //点击遮罩关闭层
                    area: ['80%', '98%'],
                    content: "{:U('vip/viewClassRecord')}&id="+id+"&status=1"

                });
            });
            $('button.bookCoachTime').click(function () {

                var id = $(this).attr("id");
                layer.open({

                    type: 2,
                    title: '预约教练的时间',
                    maxmin: false,
                    shadeClose: true, //点击遮罩关闭层
                    area: ['98%', '98%'],
                    content: "{:U('vip/bookCoachTime')}&courseId="+id,
                    cancel: function(index){
                        window.location.reload();
                    }

                });
            });
        });

    </script>
    <form class="well form-search" method="post" style="float:left;width:100%;" action="{:U('vip/viewBindingCoach')}">
    <input type="hidden" name="id" value="{$id}"/>
    <div class="search_type cc mb10">
        <div class="mb10">
        <span class="mr20">
              店&nbsp;&nbsp;&nbsp;&nbsp;铺：{:getShopSelectHtml($shopId,1)}
              有余课：{:getEnumSelectWidget($leftStatus, 'isRemain', $isRemain, 1)}
            <button class="btn btn-primary">搜索</button>
            <a class="btn" href="{:U('vip/viewBindingCoach',array('id'=>$id))}">重置</a>
                    
        </span>
        </div>
    </div>
</form>
<div class="wrap J_check_wrap">
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th>编号</th>
            <th>店铺</th>
            <th>教练名称</th>
            <th>剩余课程</th>
            <th>总上课次数</th>
            <th>待上课次数</th>
            <th>预约</th>
            <th>上课记录</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="list" item="vo">
            <tr>
                <td>{$vo.course_id}</td>
                <td>{$vo.shop_name}</td>
                <td>{$vo.coach_name}</td>
                <td>{$vo.left_class_number} 节</td>
                <td>{$vo.total_class_number} 节</td>
                <td>{$vo.wait_class_number} 节</td>
                <td>
                    <if condition='$vo.left_class_number egt 1'>
                        <button class="bookCoachTime btn" id="{$vo['course_id']}">预约</button>
                    <else/>
                        <button class="bookCoachTime btn" id="{$vo['course_id']}" disabled="true">预约</button>
                    </if>
                    
                </td>
                <td><button class="viewClassRecord btn" id="{$vo['course_id']}">查看</button></td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="pagination">{$page}</div>
</div>
<script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>